group { name: "e/conf/randr/main";
   images.image: "diagonal_stripes.png" COMP;
   parts {
      part { name: "bg"; type: RECT;
         scale: 1;
         description { state: "default" 0.0;
            rel1.offset: 2 2;
            rel2.offset: -3 -3;
            color_class: "/bg-dark/normal";
            min: 18 18;
            offscale;
         }
      }
      part { name: "pat";
         scale: 1;
         description
           { state: "default" 0.0;
              rel.to: "bg";
              rel1.offset: 2 2;
              rel2.offset: -3 -3;
              image.normal: "diagonal_stripes.png";
              color_class: "/bg-dark-alt/normal";
              TILED_PATTERN(240, 240)
              offscale;
           }
      }
      part { name: "clipper"; type: RECT;
         description { state: "default" 0.0;
            rel.to: "pat";
         }
      }
      part { name: "e.swallow.content"; type: SWALLOW;
         clip_to: "clipper";
         scale: 1;
         description { state: "default" 0.0;
            rel.to: "pat";
            rel1.offset: 2 2;
            rel2.offset: -3 -3;
            offscale;
         }
      }
   }
}

group { name: "e/conf/randr/main/monitor";
   parts {
      part { name: "e.swallow.stand"; type: SWALLOW;
         description { state: "default" 0.0;
            align: 0.5 1.0;
            rel1.relative: 0.0 0.5;
            rel2.offset: -1 30;
         }
      }
      part { name: "e.swallow.frame"; type: SWALLOW;
         description { state: "default" 0.0;
         }
      }
   }
}

group { name: "e/conf/randr/main/frame";
   styles {
      style { name: "randr_name_style";
         base: "font="FNBD" font_size=10 text_class=randr_monitor align=center color=cc:/fg/normal/text wrap=word";
         tag: "br" "\n";
         tag: "hilight" "+ font="FNBD"";
      }
      style { name: "randr_resolution_style";
         base: "font="FN" font_size=10 text_class=randr_resolution align=center color=cc:/fg/normal/tex wrap=mixed align=center";
         tag: "br" "\n";
         tag: "hilight" "+ font="FNBD"";
      }
      style { name: "randr_position_style";
         base: "font="FN" font_size=10 text_class=randr_position align=center color=cc:/fg/normal/tex wrap=mixed align=center";
         tag: "br" "\n";
         tag: "hilight" "+ font="FNBD"";
      }
   }
   script {
      public refresh_open;
   }
   parts {
      part { name: "primary"; type: RECT;
         scale: 1;
         description { state: "default" 0.0;
            color_class: "/bg-alt/normal";
            rel1.offset: -4 -4;
            rel2.offset: 3 3;
            offscale;
            visible: 0;
         }
         description { state: "on" 0.0;
            inherit: "default" 0.0;
            visible: 1;
         }
      }
      part { name: "e.swallow.preview"; type: SWALLOW;
         clip_to: "clip";
         scale: 1;
         description { state: "default" 0.0;
            rel1.offset: 5 5;
            rel2.offset: -6 -6;
            offscale;
         }
      }
      part { name: "clip"; type: RECT;
         description { state: "default" 0.0;
            rel.to: "e.swallow.preview";
         }
         description { state: "off" 0.0;
            inherit: "default" 0.0;
            color: 255 255 255 16; // no cc
         }
      }
      part { name: "e.box.clone"; type: BOX;
         clip_to: "clone_clip";
         description { state: "default" 0.0;
            rel1.to: "e.swallow.preview";
            rel1.relative: 0.0 1.0;
            rel1.offset: 0 -27;
            rel2.relative: 1.0 0.0;
            rel2.to_x: "e.swallow.preview";
            rel2.to_y: "e.event.indicator";
            box {
               layout: "horizontal";
               padding: 2 0;
               align: 0.0 0.5;
               min: 1 1;
            }
         }
      }
      part { name: "clone_clip"; type: RECT;
         description { state: "default" 0.0;
            rel.to: "e.box.clone";
         }
      }
      part { name: "drop_zone"; type: RECT; mouse_events: 0;
         description { state: "default" 0.0;
            rel.to: "e.swallow.preview";
            visible: 0;
         }
         description { state: "active" 0.0;
            inherit: "default" 0.0;
            color_class: "/bg/selected";
            color: 255 255 255 128; // no cc
            visible: 1;
         }
      }
      part { name: "hole"; mouse_events: 0;
         scale: 1;
         description { state: "default" 0.0;
            rel1.offset: 4 -5;
            rel1.relative: 0.0 1.0;
            rel2.offset: 4 -5;
            rel2.relative: 0.0 1.0;
            align: 0.0 1.0;
            min: 12 12;
            max: 12 12;
            image.normal: "i-radio";
            color_class: "/bg-dark/normal";
            offscale;
            fixed: 1 1;
         }
      }
      part { name: "led"; mouse_events: 0;
         scale: 1;
         description { state: "default" 0.0;
            rel.to: "hole";
            min: 10 10;
            max: 10 10;
            image.normal: "i-radio";
            color_class: "/fg/normal";
            fixed: 1 1;
         }
         description { state: "pulse" 0.0;
            inherit: "default" 0.0;
            color: 255 255 255 128; // no cc
         }
         description { state: "off" 0.0;
            inherit: "default" 0.0;
            visible: 0;
         }
      }
      part { name: "e.text.name"; type: TEXTBLOCK; mouse_events: 0;
         scale: 1;
         description { state: "default" 0.0;
            rel1.relative: 0.5 0.5;
            rel1.to: "e.swallow.preview";
            rel2.relative: 0.5 0.5;
            rel2.to: "e.swallow.preview";
            align: 0.5 1.0;
            text { style: "randr_name_style";
               min: 1 1;
               ellipsis: -1;
            }
         }
      }
      part { name: "e.text.resolution"; type: TEXTBLOCK; mouse_events: 0;
         scale: 1;
         description { state: "default" 0.0;
            rel1.relative: 0.5 0.5;
            rel1.to: "e.swallow.preview";
            rel2.relative: 0.5 0.5;
            rel2.to: "e.swallow.preview";
            align: 0.5 0.0;
            text { style: "randr_resolution_style";
               min: 1 1;
               ellipsis: -1;
            }
         }
         description { state: "off" 0.0;
            inherit: "default" 0.0;
            visible: 0;
         }
      }
      part { name: "e.text.position"; type: TEXTBLOCK; mouse_events: 0;
         clip_to: "clip";
         scale: 1;
         description { state: "default" 0.0;
            rel1.relative: 0.5 1.0;
            rel1.to_x: "e.swallow.preview";
            rel1.to_y: "e.text.resolution";
            rel2.relative: 0.5 0.5;
            rel2.to: "e.swallow.preview";
            align: 0.5 0.0;
            text { style: "randr_position_style";
               min: 1 1;
               ellipsis: -1;
            }
         }
         description { state: "off" 0.0;
            inherit: "default" 0.0;
            visible: 0;
         }
      }
      part { name: "pwrhint"; mouse_events: 0;
         scale: 1;
         description { state: "default" 0.0;
            rel.to: "hole";
            rel1.relative: 0.0 1.0;
            rel1.offset: 0 3;
            rel2.offset: -1 3;
            align: 0.5 0.0;
            FIXED_SIZE(15, 15)
            image.normal: "i-arrow-u";
            fixed: 1 1;
            color_class: "/fg-alt/selected";
            offscale;
         }
      }
      part { name: "pwrhint2"; mouse_events: 0;
         scale: 1;
         description { state: "default" 0.0;
            rel1.to: "pwrhint";
            rel1.relative: 1.0 0.0;
            rel2.to: "pwrhint";
            align: 0.0 0.0;
            FIXED_SIZE(20, 20)
            image.normal: "i-system-shutdown";
            fixed: 1 1;
            color_class: "/fg-alt/selected";
         }
      }
      part { name: "rsz1"; mouse_events: 0;
         scale: 1;
         description { state: "default" 0.0;
            align: 0.0 0.0;
            rel1.relative: 0.0 0.0;
            rel2.relative: 0.0 0.0;
            rel.to: "e.event.resize";
            image.normal: "i-arrow-lu";
            FIXED_SIZE(5, 5)
            color_class: "/fg-alt/selected";
         }
         description { state: "pulse" 0.0;
            inherit: "default" 0.0;
            rel1.relative: -1.0 -1.0;
            rel2.relative: -1.0 -1.0;
            color: 255 255 255 0; // no cc
         }
      }
      part { name: "rsz2"; mouse_events: 0;
         scale: 1;
         description { state: "default" 0.0;
            align: 1.0 1.0;
            rel1.relative: 1.0 1.0;
            rel2.relative: 1.0 1.0;
            rel.to: "e.event.resize";
            image.normal: "i-arrow-rd";
            FIXED_SIZE(5, 5)
            color_class: "/fg-alt/selected";
         }
         description { state: "pulse" 0.0;
            inherit: "default" 0.0;
            rel1.relative: 2.0 2.0;
            rel2.relative: 2.0 2.0;
            color: 255 255 255 0; // no cc
         }
      }
      part { name: "rotc"; type: RECT;
         scale: 1;
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            rel1.offset: 16 16;
            rel2.offset: -17 -17;
            max: 1 1;
            align: 0.9 0.1;
            offscale;
         }
      }
      part { name: "rot1"; mouse_events: 0;
         description { state: "default" 0.0;
            align: 0.0 0.0;
            rel1.relative: 0.0 0.0;
            rel2.relative: 0.0 0.0;
            rel.to: "e.event.rotate";
            image.normal: "i-arrow-r";
            FIXED_SIZE(5, 5)
            map.on: 1;
            map.smooth: 1;
            map.rotation.center: "rotc";
            color_class: "/fg-alt/selected";
         }
         description { state: "pulse" 0.0;
            inherit: "default" 0.0;
            map.rotation.z: -60;
            color: 255 255 255 0; // no cc
         }
      }
      part { name: "rot2"; mouse_events: 0;
         scale: 1;
         description { state: "default" 0.0;
            align: 1.0 1.0;
            rel1.relative: 1.0 1.0;
            rel2.relative: 1.0 1.0;
            rel.to: "e.event.rotate";
            image.normal: "i-arrow-l";
            FIXED_SIZE(5, 5)
            map.on: 1;
            map.smooth: 1;
            map.rotation.center: "rotc";
            color_class: "/fg-alt/selected";
         }
         description { state: "pulse" 0.0;
            inherit: "default" 0.0;
            map.rotation.z: 60;
            color: 255 255 255 0; // no cc
         }
      }
      part { name: "e.swallow.refresh"; type: SWALLOW;
         clip_to: "clip";
         description { state: "default" 0.0;
            rel1.to_y: "e.swallow.preview";
            rel1.to_x: "e.event.arrow.show";
            rel1.relative: 1.0 0.0;
            rel2.to: "e.swallow.preview";
            rel2.relative: 0.0 0.0;
            align: 0.0 1.0;
         }
         description { state: "expanded" 0.0;
            inherit: "default" 0.0;
            align: 0.0 0.0;
         }
      }
      part { name: "arrowclip"; type: RECT;
         description { state: "default" 0.0;
            rel.to: "e.event.arrow.show";
            visible: 1;
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            visible: 0;
         }
      }
      part { name: "arrow1clip"; type: RECT;
         clip_to: "arrowclip";
         description { state: "default" 0.0;
            rel.to: "e.event.arrow.show";
         }
         description { state: "expanded" 0.0;
            inherit: "default" 0.0;
            visible: 0;
         }
      }
      part { name: "arrow2clip"; type: RECT;
         clip_to: "arrowclip";
         description { state: "default" 0.0;
            rel.to: "e.event.arrow.show";
            visible: 0;
         }
         description { state: "expanded" 0.0;
            inherit: "default" 0.0;
            visible: 1;
         }
      }
      part { name: "arrow1"; mouse_events: 0;
         clip_to: "arrow1clip";
         scale: 1;
         description { state: "default" 0.0;
            rel.to: "e.event.arrow.show";
            image.normal: "i-arrow-d";
            FIXED_SIZE(15, 15)
            color_class: "/fg/normal";
         }
         description { state: "clicked" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/pressed";
         }
      }
      part { name: "arrow2"; mouse_events: 0;
         clip_to: "arrow2clip";
         scale: 1;
         description { state: "default" 0.0;
            rel.to: "e.event.arrow.show";
            image.normal: "i-arrow-u";
            FIXED_SIZE(15, 15)
            color_class: "/fg/normal";
         }
         description { state: "clicked" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/pressed";
         }
      }
      part { name: "e.event.arrow.show"; type: RECT;
         clip_to: "arrowclip";
         scale: 1;
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            max: 21 21;
            align: 0.0 0.0;
         }
      }
      part { name: "e.event.rotate"; type: RECT;
         scale: 1;
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            max: 21 21;
            align: 1.0 0.0;
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            visible: 0;
         }
      }
      part { name: "ind"; type: SPACER;
         scale: 1;
         description { state: "default" 0.0;
            max: 21 21;
            align: 0.0 1.0;
         }
      }
      part { name: "e.event.indicator"; type: RECT;
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            align: 0.0 1.0;
            rel2.to_y: "pwrhint2";
            rel2.to_x: "pwrhint2";
            rel1.relative: 0.0 0.0;
            rel1.to_y: "ind";
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            visible: 0;
         }
      }
      part { name: "e.event.resize"; type: RECT;
         scale: 1;
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            max: 21 21;
            align: 1.0 1.0;
         }
      }
   }
   programs {
      program { signal: "mouse,down,1"; source: "e.event.arrow.show";
         action: STATE_SET "clicked" 0.0;
         target: "arrow1";
         target: "arrow2";
      }
      program { signal: "mouse,up,1"; source: "e.event.arrow.show";
         action: STATE_SET "default" 0.0;
         target: "arrow1";
         target: "arrow2";
      }
      program { signal: "mouse,clicked,1"; source: "e.event.arrow.show";
         script {
            new shown;

            shown = get_int(refresh_open);
            if (shown) {
               run_program(PROGRAM:"refresh_hide");
               set_state(PART:"arrow1clip", "default", 0.0);
               set_state(PART:"arrow2clip", "default", 0.0);
            } else {
               run_program(PROGRAM:"refresh_show");
               set_state(PART:"arrow1clip", "expanded", 0.0);
               set_state(PART:"arrow2clip", "expanded", 0.0);
            }
            set_int(refresh_open, 1 - shown);
         }
      }
      program { name: "refresh_show";
         action: STATE_SET "expanded" 0.0;
         transition: DECELERATE 0.5;
         target: "e.swallow.refresh";
      }
      program { name: "refresh_hide";
         action: STATE_SET "default" 0.0;
         transition: ACCELERATE 0.5;
         target: "e.swallow.refresh";
      }
      program { signal: "e,state,refresh,enabled"; source: "e";
         action: STATE_SET "default" 0.0;
         target: "arrowclip";
      }
      program { signal: "e,state,refresh,disabled"; source: "e";
         action: STATE_SET "disabled" 0.0;
         target: "arrowclip";
      }
      program { name: "rrpulse1";
         signal: "show"; source: "";
         action: STATE_SET "pulse" 0.0;
         transition: DECELERATE 1.0;
         target: "rsz1";
         target: "rsz2";
         target: "rot1";
         target: "rot2";
         after: "rrpulse2";
      }
      program { name: "rrpulse2";
         action: STATE_SET "default" 0.0;
         target: "rsz1";
         target: "rsz2";
         target: "rot1";
         target: "rot2";
         after: "rrpulse1";
      }
      program { name: "pulse1";
         signal: "show"; source: "";
         action: STATE_SET "pulse" 0.0;
         transition: SINUSOIDAL 0.3;
         target: "led";
         after: "pulse2";
      }
      program { name: "pulse2";
         action: STATE_SET "default" 0.0;
         transition: SINUSOIDAL 0.3;
         target: "led";
         after: "pulse1";
      }
      program { signal: "e,state,enabled"; source: "e";
         action: STATE_SET "default" 0.0;
         target: "clip";
         target: "e.text.resolution";
         target: "e.text.position";
         target: "led";
         after: "pulse1";
      }
      program { signal: "e,state,disabled"; source: "e";
         action: ACTION_STOP;
         target: "pulse1";
         target: "pulse2";
         after: "off";
      }
      program { name: "off";
         signal: "e,state,disabled"; source: "e";
         action: STATE_SET "off" 0.0;
         target: "led";
         target: "clip";
         target: "e.text.resolution";
         target: "e.text.position";
      }
      program { signal: "e,state,drop,on"; source: "e";
         action: STATE_SET "active" 0.0;
         target: "drop_zone";
      }
      program { signal: "e,state,drop,off"; source: "e";
         action: STATE_SET "default" 0.0;
         target: "drop_zone";
      }
      program { signal: "e,state,rotate_disabled"; source: "e";
         action: STATE_SET "disabled" 0.0;
         target: "e.event.rotate";
      }
      program { signal: "e,state,indicator,enabled"; source: "e";
         action: STATE_SET "default" 0.0;
         target: "e.event.indicator";
      }
      program { signal: "e,state,indicator,disabled"; source: "e";
         action: STATE_SET "disabled" 0.0;
         target: "e.event.indicator";
      }
      program { signal: "e,state,primary,off"; source: "e";
         action: STATE_SET "default" 0.0;
         target: "primary";
      }
      program { signal: "e,state,primary,on"; source: "e";
         action: STATE_SET "on" 0.0;
         target: "primary";
      }
      program { signal: "mouse,in"; source: "e.event.resize";
         action: SIGNAL_EMIT "e,action,resize,in" "e";
      }
      program { signal: "mouse,out"; source: "e.event.resize";
         action: SIGNAL_EMIT "e,action,resize,out" "e";
      }
      program { signal: "mouse,down,1"; source: "e.event.resize";
         action: SIGNAL_EMIT "e,action,resize,start" "e";
      }
      program { signal: "mouse,up,1"; source: "e.event.resize";
         action: SIGNAL_EMIT "e,action,resize,stop" "e";
      }
      program { signal: "mouse,in"; source: "e.event.rotate";
         action: SIGNAL_EMIT "e,action,rotate,in" "e";
      }
      program { signal: "mouse,out"; source: "e.event.rotate";
         action: SIGNAL_EMIT "e,action,rotate,out" "e";
      }
      program { signal: "mouse,down,1"; source: "e.event.rotate";
         action: SIGNAL_EMIT "e,action,rotate,start" "e";
      }
      program { signal: "mouse,up,1"; source: "e.event.rotate";
         action: SIGNAL_EMIT "e,action,rotate,stop" "e";
      }
      program { signal: "mouse,in"; source: "e.event.indicator";
         action: SIGNAL_EMIT "e,action,indicator,in" "e";
      }
      program { signal: "mouse,out"; source: "e.event.indicator";
         action: SIGNAL_EMIT "e,action,indicator,out" "e";
      }
      program { signal: "mouse,clicked,1"; source: "e.event.indicator";
         action: SIGNAL_EMIT "e,action,indicator,toggle" "e";
      }
   }
}

group { name: "e/conf/randr/main/stand";
   parts {
   }
}

group { name: "e/conf/randr/main/mini";
   parts {
      part { name: "base"; type: RECT;
         description { state: "default" 0.0;
            color_class: "/bg-dark/normal";
         }
      }
      part { name: "e.swallow.preview"; type: SWALLOW;
         clip_to: "clip";
         scale: 1;
         description { state: "default" 0.0;
            rel1.offset: 5 5;
            rel2.offset: -6 -6;
            offscale;
         }
      }
      part { name: "clip"; type: RECT;
         description { state: "default" 0.0;
            rel.to: "e.swallow.preview";
         }
      }
   }
}
